﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>{$config.sitename}</title>

    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link type="text/css" rel="stylesheet" href="/templatesstore/css/reset1334.css">
    <link type="text/css" rel="stylesheet" href="/templatesstore/css/base1338.css">
     <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/templatesstore/js/touch.js"></script>
</head>

<body class="bg8 hAndroid hAndroid2x">
    <!--music-->
    <style>
        .btn_music {
            display: inline-block;
            width: 35px;
            height: 35px;
            background: url('/templatesstore/images/play.png') no-repeat center center;
            background-size: 100% auto;
            position: absolute;
            z-index: 100;
            left: 15px;
            top: 20px;
        }

            .btn_music.on {
                background-image: url("/templatesstore/images/stop.png");
            }
    </style>
   
    <script>

        var playbox = (function () {
            //author:lipu
            var _playbox = function () {
                var that = this;
                that.box = null;
                that.player = null;
                that.src = null;
                that.on = false;
                //
                that.autoPlayFix = {
                    on: true,
                    //evtName: ("ontouchstart" in window)?"touchend":"click"
                    evtName: ("ontouchstart" in window) ? "touchstart" : "mouseover"

                }

            }
            _playbox.prototype = {
                init: function (box_ele) {
                    this.box = "string" === typeof (box_ele) ? document.getElementById(box_ele) : box_ele;
                    this.player = this.box.querySelectorAll("audio")[0];
                    this.src = this.player.src;
                    this.init = function () { return this; }
                    this.autoPlayEvt(true);
                    return this;
                },
                play: function () {
                    if (this.autoPlayFix.on) {
                        this.autoPlayFix.on = false;
                        this.autoPlayEvt(false);
                    }
                    this.on = !this.on;
                    if (true == this.on) {
                        this.player.src = this.src;
                        this.player.play();
                    } else {
                        this.player.pause();
                        this.player.src = null;
                    }
                    if ("function" == typeof (this.play_fn)) {
                        this.play_fn.call(this);
                    }
                },
                handleEvent: function (evt) {
                    this.play();
                },
                autoPlayEvt: function (important) {
                    if (important || this.autoPlayFix.on) {
                        document.body.addEventListener(this.autoPlayFix.evtName, this, false);
                    } else {
                        document.body.removeEventListener(this.autoPlayFix.evtName, this, false);
                    }
                }
            }
            //
            return new _playbox();
        })();

        playbox.play_fn = function () {
            this.box.className = this.on ? "btn_music on" : "btn_music";
        }
    </script>

    <script type="text/javascript">
        $(document).ready(function () {
            playbox.init("playbox");
            /*
            setTimeout(function() {
                // IE
                if(document.all) {
                    document.getElementById("playbox").click();
                }
                // 其它浏览器
                else {
                    var e = document.createEvent("MouseEvents");
                    e.initEvent("click", true, true);
                    document.getElementById("playbox").dispatchEvent(e);
                }
            }, 2000);
            */
        });

    </script>
    <span id="playbox" class="btn_music" onclick="playbox.init(this).play();">
        <audio id="audio" loop src="{$config.bgmusic}"></audio>
    </span>
    <section id="container">
        <section class="ap oh carouselBox" id="carouselBox" ontouchstart="touchStart(event)" ontouchmove="touchMove(event);" ontouchend="touchEnd(event);" style="overflow: hidden;">
            <ul class="oh ab carouselPics" id="carouselPics" style="width: 500%; position: relative; left: -2px;">
                   <vt:function var="hdp" method="getHdp" type="$this" rows="6" />
                <vt:foreach from="$hdp" item="p" index="i">
                  <li style="width: 320px;"><a href="javascript:void(0)">
                    <img src="{$p.img_url}"></a></li>
      
            </vt:foreach>
             
            </ul>
            <ul class="ab tc carouselBtns" id="carouselBtns"></ul>
        </section>
        <!--carouselBox end-->
        <ul class="oh menu61">
             <vt:function var="category" method="getCategory" type="$this" classlayer="1" />
        <vt:foreach from="$category" item="c" index="i">
            
            <li><a href="{$c.link_url}">
                <img src="{$c.ico_url}"><span>{$c.title}</span></a></li>

             </vt:foreach>
             
        </ul>
    </section>
    <!--container end-->

    <script type="text/javascript">
        var _initX = 0;
        var _finishX = 0;
        var _startX = 0;
        var _startY = 0;
        function touchStart(event) {
            _startX = event.touches[0].clientX;
            _startY = event.touches[0].clientY;
            _initX = _startX;
        }
        function touchMove(event) {
            var touches = event.touches;
            var _endX = event.touches[0].clientX;
            var _endY = event.touches[0].clientY;
            if (Math.abs(_endY - _startY) > Math.abs(_endX - _startX)) {
                return;
            }
            event.preventDefault();
            _finishX = _endX;
            var _absX = Math.abs(_endX - _startX);
            var lastX = $('#carouselPics').css('left').replace('px', '');
            if (_startX > _endX) {
                st.Stop();
                $('#carouselPics').css('left', (parseInt(lastX) - _absX) + 'px');
            } else {
                st.Stop();
                $('#carouselPics').css('left', (parseInt(lastX) + _absX) + 'px');
            }
            _startX = _endX;
        }
        function touchEnd(event) {
            if (_finishX == 0) {
                return;
            }
            if (_initX > _finishX) {
                bindEvent(_initX, _finishX);
            } else if (_initX < _finishX) {
                bindEvent(_initX, _finishX);
            }
            _initX = 0;
            _finishX = 0;
        }

        var picCount = $("#carouselPics li").length;

        $("#carouselPics").css('width', picCount + '00%');

        var st = createPicMove("carouselBox", "carouselPics", picCount);

        var forEach = function (array, callback) {
            for (var i = 0, len = array.length; i < len; i++) { callback.call(this, array[i], i); }
        }

        var nums = [];

        for (var i = 0, n = st._count - 1; i <= n; i++) {
            var li = document.createElement("li");
            nums[i] = document.getElementById("carouselBtns").appendChild(li);
        }

        st.onStart = function () {
            forEach(nums, function (o, i) { o.className = st.Index == i ? "current" : ""; })
        }

        function bindEvent(start, end) {
            if (start >= end) {
                st.Next();
            } else {
                st.Previous();
            }
        }

        st.Run();

        var resetScrollEle = function () {
            var slider2Li = $("#carouselPics li");
            slider2Li.css("width", $(".carouselBox").width() + "px");

            var oHeight1 = $(window).height();
            var oHeight2 = $('body').height();
            var oFooterHeight = $('#footer').outerHeight();
            if (oHeight1 > oHeight2) {
                $('#container').css('min-height', (oHeight1 - oFooterHeight));
            }
        };

        resetScrollEle();

        window.addEventListener("orientationchange", function () {
            st.Change = st._slider.offsetWidth / st._count;
            st.Next();
            resetScrollEle();
        });

        window.addEventListener("resize", function () {
            st.Change = st._slider.offsetWidth / st._count;
            st.Next();
            resetScrollEle();
        });
    </script>


    <div style="height: 34px; line-height: 34px; font-size: 12px; background: #e3e2dd; text-align: center; color: #999;">
        <p>技术支持：<a href="111" target="_blank" style="color: #666666; text-decoration: none;">{$config.wcopyright}</a></p>
    </div>
       <div style="display: none">©上海沐雪网络科技提供</div>
     
    <script>
        function displayit(n) {
            for (i = 0; i < 4; i++) {
                if (i == n) {
                    var id = 'menu_list' + n;
                    if (document.getElementById(id).style.display == 'none') {
                        document.getElementById(id).style.display = '';
                        document.getElementById("plug-wrap").style.display = '';
                    } else {
                        document.getElementById(id).style.display = 'none';
                        document.getElementById("plug-wrap").style.display = 'none';
                    }
                } else {
                    if ($('#menu_list' + i)) {
                        $('#menu_list' + i).css('display', 'none');
                    }
                }
            }
        }
        function closeall() {
            var count = document.getElementById("top_menu").getElementsByTagName("ul").length;
            for (i = 0; i < count; i++) {
                document.getElementById("top_menu").getElementsByTagName("ul").item(i).style.display = 'none';
            }
            document.getElementById("plug-wrap").style.display = 'none';
        }

        document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
            WeixinJSBridge.call('hideToolbar');
        });
    </script>
    <!-- share -->

     

    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
     
      <!--_share_js-->
        <vt:template id="share_js" file="../../csmall/_share_js_index.html" charset="utf-8" />
        <!--/_share_js-->
        <!--_bottommenu-->
        <vt:template id="bottommenu" file="../../bmenu/bottom.html" charset="utf-8" />
        <!--/_bottommenu-->
</body>
</html>
